{
grant_entry_v1_t *sha = &shared_entry_v1(e->grant_table, gop.ref);
- guest_physmap_add_page(e, _gfn(sha->frame), mfn, 0);
+ rc = guest_physmap_add_page(e, _gfn(sha->frame), mfn, 0);
if ( !paging_mode_translate(e) )
sha->frame = mfn_x(mfn);
}
{
grant_entry_v2_t *sha = &shared_entry_v2(e->grant_table, gop.ref);
- guest_physmap_add_page(e, _gfn(sha->full_page.frame), mfn, 0);
+ rc = guest_physmap_add_page(e, _gfn(sha->full_page.frame), mfn, 0);
if ( !paging_mode_translate(e) )
sha->full_page.frame = mfn_x(mfn);
}
rcu_unlock_domain(e);
- gop.status = GNTST_okay;
+ gop.status = rc ? GNTST_general_error : GNTST_okay;
copyback:
if ( unlikely(__copy_field_to_guest(uop, &gop, status)) )
mfn = page_to_mfn(page);
}
- guest_physmap_add_page(d, _gfn(gpfn), mfn, a->extent_order);
+ if ( guest_physmap_add_page(d, _gfn(gpfn), mfn, a->extent_order) )
+ goto out;
if ( !paging_mode_translate(d) &&
/* Inform the domain of the new page's machine address. */
}
mfn = page_to_mfn(page);
- guest_physmap_add_page(d, _gfn(gpfn), mfn,
- exch.out.extent_order);
+ rc = guest_physmap_add_page(d, _gfn(gpfn), mfn,
+ exch.out.extent_order) ?: rc;
if ( !paging_mode_translate(d) &&
__copy_mfn_to_guest_offset(exch.out.extent_start,
p2m_type_t t);
/* Untyped version for RAM only, for compatibility */
-static inline int guest_physmap_add_page(struct domain *d,
- gfn_t gfn,
- mfn_t mfn,
- unsigned int page_order)
+static inline int __must_check
+guest_physmap_add_page(struct domain *d, gfn_t gfn, mfn_t mfn,
+ unsigned int page_order)
{
return guest_physmap_add_entry(d, gfn, mfn, page_order, p2m_ram_rw);
}
p2m_type_t t);
/* Untyped version for RAM only, for compatibility and PV. */
-int guest_physmap_add_page(struct domain *d, gfn_t gfn, mfn_t mfn,
- unsigned int page_order);
+int __must_check guest_physmap_add_page(struct domain *d, gfn_t gfn, mfn_t mfn,
+ unsigned int page_order);
/* Set a p2m range as populate-on-demand */
int guest_physmap_mark_populate_on_demand(struct domain *d, unsigned long gfn,